﻿// ===============================================================================
// XCI.Parent 西安交通信息WinForm开发框架 2019 版权所有
// ===============================================================================

using System;
using XCI.Windows;

namespace XCI.Sys.Forms
{
    /// <summary>
    /// 系统日志管理
    /// </summary>
    [FormCaption("系统日志管理")]
    public partial class FrmLogManager : BaseForm
    {
        public FrmLogManager()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 页面加载事件
        /// </summary>
        private async  void FrmLogManager_Load(object sender, EventArgs e)
        {
            await tabPane.BindingModelAsync();
        }

        private void TabPane_PageBinding(object sender, DetailsFormPaneBindingEventArgs e)
        {
            e.Task = async () =>
            {
                switch (e.Current.TabPageName)
                {
                    case nameof(tabOperateLog):
                        await operateLogManagerUserControl1.LoadFirstPageAsync();
                        break;
                    case nameof(tabLoginLog):
                        await loginLogManagerUserControl1.LoadFirstPageAsync();
                        break;
                    case nameof(tabHistoryLog):
                        await historyManagerUserControl1.LoadFirstPageAsync();
                        break;
                    case nameof(tabJobLog):
                        break;
                    case nameof(tabErrorLog):
                        await errorLogManagerUserControl1.LoadFirstPageAsync();
                        break;
                }
            };
        }
    }
}